import React from 'react'
import ReactDOM from 'react-dom'

function UserGreeting(props) {
  return <h1>Welcome back!</h1>;
};

function GuestGreeting(props) {
  return <h1>Please sogin up!</h1>;
};

function Greeting(props) {
  const isLogin = props.isLogin;
  if (isLogin) {
    return <UserGreeting />;
  }
  return <GuestGreeting />;
};

ReactDOM.render(
  <Greeting isLogin={false} />,
  document.getElementById('root')
);